﻿<local:DocumentBase x:Class="WPFExcelReport.JLTEKGBSUPP"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    
                    Background="White" 
                    Loaded="Window_Loaded" 
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <CollectionViewSource   x:Key="vwEKPOS" Source="{Binding Path=ICC_EKPOS,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" Width="1021">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0"   Grid.ColumnSpan="2">
            <WrapPanel>
                <Label Content="采购下单日期从" Height="26" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label3" VerticalAlignment="Top" Width="103" FontSize="14" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DATE" VerticalAlignment="Top" Panel.ZIndex="4"
                                    SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="103" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label4" VerticalAlignment="Top" Width="19" FontSize="14" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DATE" VerticalAlignment="Top" Panel.ZIndex="5"
                                    SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="101" />
                <Label Content="收货日期从" Height="26" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label1" VerticalAlignment="Top" Width="76" FontSize="14" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DN_DATE" VerticalAlignment="Top" Panel.ZIndex="7"
                                    SelectedDateChanged ="FROM_DN_DATE_SelectedDateChanged" Width="103" />
                <Label Content="至" Height="28" HorizontalAlignment="Left" Margin="10,5,0,0" Name="label2" VerticalAlignment="Top" Width="19" FontSize="14" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DN_DATE" VerticalAlignment="Top" Panel.ZIndex="8"
                                    SelectedDateChanged ="END_DN_DATE_SelectedDateChanged" Width="101" />
                <Button Content="供应商排名" Height="33" Margin="5,0,0,0"  Name="btnQuery" Width="67" Panel.ZIndex="9"
                        Click="btnQuery_Click"/>
                <Button Content="导出" Height="33" Margin="5,0,0,0"  Name="btnEXCEL" Width="44" Panel.ZIndex="10"
                        Click="btnEXCEL_Click"/>
                <Button Content="纱线排名" Height="33" Margin="10,0,0,0"  Name="btnYARNQuery" Width="67" Panel.ZIndex="11"
                        Click="btnYARNQuery_Click"/>
                <Button Content="导出" Height="33" Margin="5,0,0,0"  Name="btnYARNEXCEL" Width="44" Panel.ZIndex="12"
                        Click="btnYARNEXCEL_Click"/>
                <Button Content="订单明细" Height="33" Margin="10,0,0,0"  Width="Auto" Panel.ZIndex="14"
                        Click="btnDetail_Click"/>
            </WrapPanel>
        </StackPanel>
        <DataGrid
                    Grid.Row="1" Grid.Column="0"    
            CanUserReorderColumns="True"  
            CanUserResizeRows="True" CanUserSortColumns="True"            
            AutoGenerateColumns="False"   
            EnableRowVirtualization="True"   
            FontSize="11"
            EnableColumnVirtualization="True"  
            ScrollViewer.HorizontalScrollBarVisibility="Auto"
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            SelectionChanged="MasterDg_SelectionChanged"
            RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
            IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
            ItemsSource="{Binding}" x:Name="MasterDg" 
            >
            <!--SUPP,SUPPNAME,QTY,INQTY-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=CODE}" Header="编号" Width="SizeToCells" MinWidth="50" />
                <DataGridTextColumn Binding="{Binding Path=DES}" Header="名称" Width="SizeToCells" MinWidth="70" />
                <DataGridTextColumn Binding="{Binding Path=QTY}" Header="采购量KG" Width="SizeToCells" MinWidth="50" />
                <DataGridTextColumn Binding="{Binding Path=INQTY}" Header="入库量KG" Width="SizeToCells" MinWidth="50" />
            </DataGrid.Columns>
        </DataGrid  >
        <DataGrid  Grid.Row="1" Grid.Column="1" VerticalAlignment="Top"  
                                   AutoGenerateColumns="False"
                                   EnableRowVirtualization="False"
                                   VerticalScrollBarVisibility="Auto"
                                   HorizontalScrollBarVisibility="Auto"
                   FontSize="11"
                                   HeadersVisibility="Column"                 
                                   HorizontalAlignment="Stretch"               
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwEKPOS}}"  
                                   x:Name="dlgEKP" 
                                   Margin="0,1,0,0"             
                                   RowDetailsVisibilityMode="Visible"
                    >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=EKPAUFKRS, Converter={StaticResource ResourceKey=Trim}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD, Converter={StaticResource ResourceKey=Trim}}" Header="采购单"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS, Converter={StaticResource ResourceKey=Trim}}" Header=""  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPART, Converter={StaticResource ResourceKey=Trim}}" Header="物料"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="色号"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LSNAME1, Converter={StaticResource ResourceKey=gb2312}}" Header="供应商"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPME1, Converter={StaticResource ResourceKey=d100}}" Header="数量"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPME3, Converter={StaticResource ResourceKey=d100}}" Header="入库数量"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPWE1, Converter={StaticResource ResourceKey=d100}}" Header="价值"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=EKPPRME, Converter={StaticResource ResourceKey=d1000}}" Header="单价"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</local:DocumentBase>
